<template>
    <!-- 进入hid -->
    <div class="bg-full">
      <HeaderNav></HeaderNav>
    
      <div class="title">{{ $t('welcome.title') }}</div>
      <div class="desc">{{ $t('welcome.desc1') }}</div>
      <div class="desc">{{ $t('welcome.desc2') }}</div>
      <div class="hub-button" @click="handleConnect">{{ $t('welcome.initDevice') }}</div>
      <div class="device-info">
        <div class="device-list">{{ $t('welcome.supportedDevices') }}</div>
        <div class="device-list-box">
            <div class="device-list">{{ $t('welcome.customKeyboard') }}</div>
            <div class="device-list">{{ $t('welcome.magneticKeyboard') }}</div>
            <div class="device-list">{{ $t('welcome.gamingMouse') }}</div>
        </div>

        <div class="device-list">{{ $t('welcome.moreDevices') }}</div>
        <div class="device-list">
          {{ $t('welcome.firmwareUpdatePrefix') }}<a class="link-text" :href="firmwareUpdateUrl" target="_blank">{{ firmwareUpdateUrl }}</a>{{ $t('welcome.firmwareUpdateSuffix') }}</div>
      </div>
        
      <div class="footer">
        <a href="https://beian.miit.gov.cn/" target="_blank" >赣ICP备2022003157号-1</a>
      </div>
    </div>
  </template>
  
  <script setup>
  import HeaderNav from "./HeaderNav.vue";
  import { useI18n } from 'vue-i18n';
  import { useRouter } from 'vue-router';
  const router = useRouter();
  const { t } = useI18n();
  const emit = defineEmits(["btnClcik"]); // 声明自定义事件
  const handleConnect = async () => {
    emit("btnClcik");
  };

  const firmwareUpdateUrl = `${window.location.origin}/#/update`;
  </script>
  
  <style scoped>
  .bg-full {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    height: 100vh;
  }
  /* 设备信息框 */
  .device-info {
    background-color: rgba(255, 255, 255, 0.2);
    width: 842px;
    box-sizing: border-box;
    padding: 10px 20px;
    text-align: left;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
  }
  .device-list-box{
    margin-left: -6px;
    margin-bottom: 15px;
  }
  .title{
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
  }
  .desc{
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
  }
  
  .device-list {
    font-size: 14px;
    line-height: 1.6;
    color:rgba(255, 255, 255, 0.6);
  }
  
  /* 进入HUB按钮 */
  .hub-button {
    width: 200px;
    height: 44px;
    line-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b35, #ff4500);
    color: white;
    border-radius: 22px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 30px 0;
    margin-top: 40px;
  }
  .footer{
    position: fixed;
    bottom: 0;
    height: 30px;
    color: #999;
  }
  .footer{
    position: fixed;
    bottom: 0;
    height: 30px;
    color: #999;
  }
  .link-text{
    text-decoration: underline;
    cursor: pointer;
    color:#fff;
  }
  </style>
  